<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";

const routvanist = useRouter();

let num = ref(0);

const myclick = function(coms) {
    num.value++
    console.log(num);
    routvanist.push(coms)
};
</script>

<template>
  <div>
    <h1>这是App 根组件: vanement-plus</h1>
    <van-button @click="myclick('buttonmy')">按钮</van-button>
    <van-button @click="myclick('tabmy')">表格</van-button>
   
    <hr />
    <router-view></router-view>
  </div>
</template>

<style scoped>
.red {
  color: red;
}
</style>
